<template>
  <div v-if="$store.getters.headFlag">
    <div class="nav_wrap">
      <ul>
        <li>
          <div class="navName">
            <i class="icon icon-user"></i>
            <span>用户管理</span>
          </div>
          <div class="sec_item">
            <div class="item">
              <a href="/admin">
                <i class="icon icon-user"></i>
                <span>系统人员</span>
              </a>
            </div>
            <div class="item">
              <a href="/student">
                <i class="icon icon-user"></i>
                <span>学员管理</span>
              </a>
            </div>
          </div>
        </li>
        <li>
          <div class="navName">
            <i class="icon icon-user"></i>
            <span>课程管理</span>
          </div>
          <div class="sec_item">
            <div class="item">
              <a href="">
                <i class="icon icon-user"></i>
                <span>课程管理</span>
              </a>
            </div>
            <div class="item">
              <a href="">
                <i class="icon icon-user"></i>
                <span>课程编辑</span>
              </a>
            </div>
            <div class="item">
              <a href="/video">
                <i class="icon icon-user"></i>
                <span>视频管理</span>
              </a>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
export default {
  name: "navcom"
}
</script>
<style lang="less">
.nav_wrap {
  width: 100%;
  height: 50px;
  background: skyblue;
  ul {
    display: flex;
    color: white;
    line-height: 50px;
    li {
      width: 120px;
      text-align: center;
      margin-left: 70px;
      cursor: pointer;
      // position: relative;
      &:hover .sec_item {
        display: block;
      }
    }
  }
}
.navName {
  position: relative;
}
.nav_wrap li:hover > .navName::after {
  top: 38px;
  left: 84px;
  opacity: 1;
}
.nav_wrap li:hover > .navName::before {
  bottom: 38px;
  right: 84px;
  opacity: 1;
}

.navName::after,
.navName::before {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  opacity: 0;
  transition: all 0.3s;
}
.navName::after {
  top: 20px;
  left: 66px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
}
.navName::before {
  bottom: 20px;
  right: 66px;
  border-left: 2px solid white;
  border-top: 2px solid white;
}

.sec_item {
  width: 100%;
  height: 150px;
  position: absolute;
  z-index: 999;
  background: white;
  top: 97px;
  display: none;
  left: 0;
  border-bottom: 1px solid black;
  > div {
    float: left;
    margin-left: 100px;
    margin-top: 50px;
    width: 120px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    border: 1px solid blue;
    &:hover {
      transition: all 0.5s;
      background: skyblue;
      color: white;
      font-size: 20px;
    }
  }
}
</style>